li      r2, 10
li      r3, 30
li      r4, 70
li      r5, 100
li      r6, 130
li      r7, 160
li      r8, 0



init: 
mv	r10, r2 
sub      r10 ,r8

blez     r10, endinit

mv r9, r3
add	r9, r8		// memlocation = base address + offset into A
store	r8, 0(r9)		// A[i] = i

mv r9, r4
add r9, r8  // memlocation = base address + offset into B		
store	r8, 0(r9)		// B[i] = i

mv r9, r5
add r9, r8		// memlocation = base address + offset into C
store	r8, 0(r9)		// C[i] = i

mv r9, r6
add r9, r8		// memlocation = base address + offset into D
store	r8, 0(r9)		// D[i] = i

mv r9, r7		// memlocation = base address + offset into E
add r9, r8
store	r8, 0(r9)		// E[i] = i

addi	r8, 1		// i++

bez     r0,init

endinit:

li r8, 0		// i=0
li r2, 10

loop:

mv   r9, r2
sub   r9, r8

blez     r9, endloop


mv   r10, r5
add  r10, r8		// memlocation C[i] = base addr of C + offset

mv   r11, r3
add	r11, r8		// memlocation A[i] = base addr of A + offset
load	r14, 0(r11)		// r14 = A[i]

mv    r12, r4
add	r12, r8		// memlocation B[i] = base addr of B + offset
load	r15, 0(r12)		// r14 = B[i]

mv  r13, r14
add	r13, r15		// r13 = A[] + B[]
store	r13, 0(r10)		// C[i] = r13

addi	r8, 1		// i++

bez     r0,loop
	
endloop:

mv  r8, r0		// i=0
li r2, 10



loop2:
mv  r9, r2
sub    r9, r8
blez    r9, endloop2

mv  r10, r6
add	r10, r8		// memlocation D[i] = base addr of D + offset

mv  r11, r5
add	r11, r8		// memlocation C[i] = base addr of C + offset
load	r14, 0(r11)		// r14 = C[i]

mv  r12, r7
add	r12, r8		// memlocation E[i] = base addr of E + offset
load	r15, 0(r12)		// r15 = E[i]

mv  r13, r14
add	r13, r15		// r13 = C[] + E[]
store	r13,  0(r10)		// D[i] = r13

addi	r8, 1		// i++

bez     r0,loop2
	
endloop2:







li r2, 10
mv r8, r0
loop1:

mv  r9, r2
sub     r9, r8
blez    r9, endloop1
	
mv    r11, r3
add	r11, r8		// memlocation A[i] = base addr of A + offset
load	r14, 0(r11)		// r14 = A[i]

mv  r12, r4
add	r12, r8		// memlocation B[i] = base addr of B + offset
load	r15, 0(r12)		// r14 = B[i]

mv  r13, r14
add	r13, r15		// r13 = A[] + B[]
store	r13, 0(r11)		// A[i] = r13

addi	r8, 1		// i++
bez     r0,loop1

endloop1:
